package org.tale.bootdemo;

import com.alibaba.nacos.api.exception.NacosException;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class BootDemoApplication {

/*    @NacosInjected
    private NamingService namingService;
    @NacosInjected
    private  ConfigService configService;*/

    @Value("${server.port}")
    private int serverPort;
    
    @Value("${spring.application.name}")
    private String applicationName;
    
    public static void main(String[] args) {
        SpringApplication.run(BootDemoApplication.class, args);
    }

    /**
     * 手动注册服务
     * @throws NacosException
     */
/*    @PostConstruct
    public void registerInstance() throws NacosException {
        namingService.registerInstance(applicationName,"demo-group","127.0.0.1",serverPort);
    }*/

/*    @PostConstruct
    public void publishConfig() throws NacosException{
        configService.publishConfig("demo","demo-group","useLocalCache=true");
    }*/

}
